package com.bitauto.i.commonUtils.utils;

public class ThreadTest {

    public static void main(String[] args) {

        testJoin();
    }

    private static void testJoin(){
        Thread t1 =new Thread(()->{
                for (int i = 0; i < 100;i++) {
                    System.out.println("A===="+i);
                }
        });

        Thread t2 =new Thread(()->{
            try {
                t1.join();
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }

            for (int i = 0; i < 100;i++) {
                System.out.println("B---"+i);
            }
        });

        t1.start();
        t2.start();

    }

}
